<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<%@ include file="/commons/kindeditor.jsp" %>
<script type="text/javascript">
    $(function() {
    	//初始化类目选择和图片上传器
		TAOTAO.init({fun:function(node){}});
        $('#demo2EditForm').form({
            url : '${path}/admin/demo2/edit',
            onSubmit : function() {
                progressLoad();
                var isValid = $(this).form('validate');
                if (!isValid) {
                    progressClose();
                }
                return isValid;
            },
            success : function(result) {
                progressClose();
                result = $.parseJSON(result);
                if (result.success) {
                    parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
                    parent.$.modalDialog.handler.dialog('close');
                } else {
                    parent.$.messager.alert('错误', result.msg, 'error');
                }
            }
        });
    });
</script>
<div style="padding:10px 10px 10px 10px">
        <form id="demo2EditForm" method="post" enctype="multipart/form-data">
            <table class="grid">
				<input id="id" name="id" type="hidden" value="${demo2.id}" />
                <tr>
                    <td>name:</td>
					<td>
						<input id="name" name="name" type="text"  class=" easyui-textbox" data-options="prompt:'请输入name',required:true"  value="${demo2.name}" />
					</td>
				</tr>
                <tr>
                    <td>type:</td>
					<td>
						<input id="type" name="type" type="text"  class=" easyui-textbox" data-options="prompt:'请输入type',required:true"  value="${demo2.type}" />
					</td>
				</tr>
                <tr>
                    <td>图片地址:</td>
				<td><a href="javascript:void(0)" class="easyui-linkbutton onePicUpload">上传图片</a>
					<input  type="hidden" name="pic" id="pic" value="${demo2.pic}" class="img_url"/>
					<script type="text/javascript">
					$(function(){
						var imageUrls='${demo2.pic}';
						var imgs=imageUrls.split(",");
						var hl="";
						for (var i=0;i<imgs.length;i++)
						{
							hl+="<a href="+imgs[i]+" target='_blank'><img src='"+imgs[i]+"' width='90' height='90'/></a>"
						}
						$("#pic_imgs").html(hl);
					});
					</script>
					<span id="pic_imgs"></span>
				</td>
				</tr>
                <tr>
                    <td>状态 1正常 0停用:</td>
					<td>
						<select id="status" name="status" class="easyui-combobox" data-options="width:140,height:29,editable:false,panelHeight:'auto'">
							${ dic:getBusDictListToOption('DATA_STATUS')}
						</select>
						<script type="text/javascript">
							//下拉框赋值
				       		 $("#status").val('${demo2.status}'); 
						</script>
					</td>
				</tr>
                <tr>
                    <td>创建时间:</td>
					<td>
						<input id="createdTime" name="createdTime" type="text"  class="easyui-datetimebox" readonly="readonly" value="<fmt:formatDate pattern='yyyy-MM-dd HH:mm:ss' value='${demo2.createdTime}'/>"/>
					</td>
				</tr>
                <tr>
                    <td>修改时间:</td>
					<td>
						<input id="updatedTime" name="updatedTime" type="text"  class="easyui-datetimebox" readonly="readonly" value="<fmt:formatDate pattern='yyyy-MM-dd HH:mm:ss' value='${demo2.updatedTime}'/>"/>
					</td>
				</tr>
                <tr>
                    <td>删除时间:</td>
					<td>
						<input id="deletedTime" name="deletedTime" type="text"  class="easyui-datetimebox" readonly="readonly" value="<fmt:formatDate pattern='yyyy-MM-dd HH:mm:ss' value='${demo2.deletedTime}'/>"/>
					</td>
				</tr>
                <tr>
                    <td>编辑人:</td>
					<td>
						<input id="createdEditor" name="createdEditor" type="text"  class=" easyui-textbox" data-options="prompt:'请输入编辑人',required:true"  value="${demo2.createdEditor}" />
					</td>
				</tr>
                <tr>
                    <td>更新人:</td>
					<td>
						<input id="updatedEditor" name="updatedEditor" type="text"  class=" easyui-textbox" data-options="prompt:'请输入更新人',required:true"  value="${demo2.updatedEditor}" />
					</td>
				</tr>
            </table>
        </form>
    </div>
